name: Test code and app
on:
  push:
    branches:
      - main
  pull_request:
    types: [ opened, synchronize, reopened ]
jobs:
  run_tests:
    name: Testing project
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        id: checkout
        uses: actions/checkout@v2

      - name: Environment setup
        uses: actions/setup-python@v2
        with:
          python-version: '3.10'
          architecture: 'x64'

      - name: Install Poetry
        uses: snok/install-poetry@v1

      - name: Install packages
        run: poetry install

      - name: Run tests
        run: poetry run pytest tests/